<?php
/**
 * Created by PhpStorm.
 * User: wdxi
 * Date: 2017/3/7
 * Time: 10:56
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Channel extends Model
{
    use SoftDeletes;//开启软删除

    protected $connection = 'mysql_thor';

    protected $dates=['deleted_at'];
    public function user()
    {
        return $this->hasMany(User::class);
    }

    public function channelReports()
    {
        return $this->hasMany(ChannelDateReport::class);
    }

    public function channelOrders()
    {
        return $this->hasMany(Order::class);
    }
    public function product(){
        return $this->belongsTo(Product::class)->withTrashed();
    }
}
